Unique Registry entry

Specify that a column or a combination of columns must be unique in order to save a record, and a message to be displayed if uniqueness is violated.

Usage

This Registry entry can be assigned to users and groups:

Key User User Group Group Group Group
Key 1 User User Group Group Group Group
Key 2 user user group group Default Default
Key 3 Table Table Table Table Table Table
Key 4 table Default table Default table Default
Key 5 Unique
Key 6 column;column;...
Value message

where:

column;column;...

is one column or a combination of columns (separated with a semicolon) that must be unique (or empty) in order to save a record.

Note that if more than one column is specified, it is the combination of columns that must be unique, not each individual column in the combination.

For example, if a unique combination of three columns is required to save a record, two records can share two of the three values, as long as the third value is different. If the combination of Field1, Field2 and Field3 must be unique, these two records could be saved:

Record 1: Field1 = A, Field2 = B, Field3 = C

Record 2: Field1 = A, Field2 = B, Field3 = D

Note:

  • Only atomic columns of basic types (text, integer, currency and float) can be used.
  • The Unique Registry entry can be applied to nested and double-nested tables: each value in the affected table must appear only once.

message

is a message shown if the combination is not unique.

In a multilingual system, translations of the message can be provided by separating translations with the language delimiter (e.g. ;:;), e.g.: message_english;:;message_french;:;...

Note:

  • Uniqueness is only checked when a record is saved.
  • If the column or combination of columns is not unique, the warning message displays and the cursor moves to the control associated with the first column listed in the Unique Registry entry.
  • Unique fields are typically set at the Group|Default level and are the same for all users, although they can be set for specific users and groups.
  • If a unique-valued field is empty but not mandatory, the record can still be saved.

Example

This entry specifies that the Birth date, Surname and First name combination in the Parties module must be unique in order to save a record:

Key Setting Description
Key 1 Group  
Key Default  
Key 3 Table  
Key 4 eparties  
Key 5 Unique  
Key 6 BioBirthDate;NamFirst;NamLast Together these three fields must be unique before the record can be saved.
Value This record is not unique. The message to display if the field or combination of fields is not unique.

When a record is saved in the Parties module, a check is made to determine whether the three specified fields are a unique combination; if not the warning message displays.